<?php
require_once ("../../src/db/connectdatabase.php");

function getidlastdealer() {
	$con = new ConnectDB();
	
	$sql = "SELECT idcode FROM registrationbank ORDER BY idcode DESC LIMIT 0,1";
	return $con -> getvalueString($sql);
}

function updateActivityDealer($email, $code) {
	$con = new ConnectDB();
	
	$tbl = "registrationbank";
	$fn = array('idcode' => $code, 'isaccept' => '1', 'dateaccept' => time());
	$condition = array('regis_email' => $email);
	return $con -> update($tbl, $fn, $condition);
}

function updateLockDealer($email) {
	$con = new ConnectDB();
	
	$tbl = "registrationbank";
	$fn = array('islock' => '1');
	$condition = array('regis_email' => $email);
	return $con -> update($tbl, $fn, $condition);
}

function updateUnlockDealer($email) {
	$con = new ConnectDB();
	
	$tbl = "registrationbank";
	$fn = array('islock' => '0');
	$condition = array('regis_email' => $email);
	return $con -> update($tbl, $fn, $condition);
}
?>